package com.guoxin.chapter4.reentractlock.lockmethodtest2.test1;

public class Run {
	public static void main(String[] args) throws InterruptedException {
		Service service = new Service();
		Runnable runnable = new Runnable() {
			public void run() {
				service.waitMethod();
			}
		};
		
		Thread a = new Thread(runnable);
		a.start();
		Thread.sleep(500);
		Thread b = new Thread(runnable);
		b.start();
		Thread.sleep(500);
		System.out.println(service.lock.hasQueuedThread(a));
		System.out.println(service.lock.hasQueuedThread(b));
		System.out.println(service.lock.hasQueuedThreads());
	}
}
